﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DannyFramework.Infrastructure
{
    /// <summary>
    /// 计时类
    /// </summary>
    public class Timing
    {
        Stopwatch sw = new Stopwatch();
        /// <summary>
        /// 开启计时
        /// </summary>
        /// <returns></returns>
        public void swStart()
        {
            sw.Start();
        }
        /// <summary>
        /// 结束计时并返回结果
        /// </summary>
        /// <returns></returns>
        public long swStop()
        {
            sw.Stop();
            return sw.ElapsedMilliseconds;
        }
    }
}
